how to determine the direction of a vector